<template>
  <div>
    <div ref="echats1" style="width: 500px; height: 500px;"></div>
  </div>
</template>

<script>
// 引入echarts包
import * as echarts from 'echarts'
export default {
  // 页面加载完成,自动执行,调用函数
  mounted () {
    this.showCharts()
  },
  // vme
  methods: {
    showCharts () {
      // 初始化echarts,到div 元素中
      const myChart = echarts.init(this.$refs.echats1)
      const option = {
        series: [
          {
            name: '业务指标',
            type: 'gauge',
            detail: { formatter: '{value}%' },
            data: [{ value: 32, name: '完成率' }]
          }
        ]
      }
      myChart.setOption(option)
    }
  }
}
</script>

<style lang="scss" scoped></style>
